<template>
	<view class="glory-warpper">
		<view class="card" v-for="(item,index) in showList" :key="index" @click="jumpItem(item)">
			<image :src="item.icon" class="card-img"></image>
			<view class="card-content">
				<view class="title">{{item.name}}</view>
				<view class="sub">查看详情</view>
			</view>
		</view>
	</view>
</template>
<script>
	import menuBox from "@/wxcomponents/commonLayout/menu";
	import userMixins from '@/libs/userMixins.js'
	export default {
		mixins: [userMixins],
		data() {
			return {
				list: []
			}
		}, 
		onShow() {
			let isStu = this.calMenuShow('教育局-学生');
			let list = [
				{
					url: isStu ? "/modules/glory/stuSkillList" : '',
					icon: '/static/jnzs.png',
					name: "技能证书"
				},
				{
					url: "/modules/glory/stuAwardList",
					icon: '/static/hjqk.png',
					name: "获奖情况"
				},
				{
					url: "/modules/glory/volunteerList",
					icon: '/static/zyz.png',
					name: "志愿者"
				},
				{
					url: "/modules/glory/researchList",
					name: "在研课题"
				},
				{
					url: "/modules/leave/applyLeave",
					name: "论文发表"
				},
				{
					url: "/modules/leave/teacherLeave",
					name: "论文获奖"
				},
				{
					url: "/modules/reimbursement/reimbursementApply",
					name: "竞赛获奖"
				},
				{
					url: "/modules/meeting/meetingApply",
					name: "指导学生获奖"
				},
				{
					url: "/modules/car/applyForCar",
					name: "技术专利"
				},
				{
					url: "/modules/seal/apply",
					name: "技能证书"
				},
				{
					url: "/modules/meal/apply",
					name: "出版著作"
				},
				{
					url: isStu ? "/modules/glory/stuCommendList" : '',
					icon: '/static/bz.png',
					name: "表彰"
				}
			]
			this.list = this.getHaveOpList(list);
		},
		methods: {
			jumpItem(item) {
				uni.navigateTo({
					url: item.url
				});
			}
		},
		components: {
			menuBox
		},
		computed: {
			showList() {
				return this.list;
			}
		}
	}
</script>

<style lang="scss" scoped>
.glory-warpper {
	display: grid;
	grid-template-columns: repeat(auto-fill, 332rpx);
	grid-row-gap: 32rpx;
	grid-column-gap: 26rpx;
	padding: 30rpx;
}
.card {
	width: 332rpx;
	height: 152rpx;
	border-radius: 10rpx;
	padding: 24rpx;
	background-color: #F7F8FA;
	display: flex;
	align-items: center;
	.card-img {
		width: 64rpx;
		height: 64rpx;
	}
	.card-content {
		padding-left: 16rpx;
		.title {
			color: #0C1227;
			font-size: 32rpx;
			font-weight: bold;
		}
		.sub {
			color: #5F636F;
			font-size: 24rpx;
		}
	}
}
	
</style>
